package ModelLayer;
/**
 * Vestbjerg project
 * @GroupB2 (UCN - Computer Science DMAJ0914) 
 */
public abstract class Person implements IFPerson, Comparable<IFPerson>
{
    //instance variables
    private String id;
    private String name;
    private String address;
    private String phone;
    private String email;
    private double totalAmount;

    /**
     * Constructor for objects of class Person
     */
    public Person(String id, String name, String address, String phone, String email)
    {
        this.id = id;
        this.name = name;
        this.address = address;
        this.phone = phone;
        this.email = email;
    }

    public void setId(String id)
    {
        this.id = id;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public void setAddress(String address)
    {
        this.address = address;
    }

    public void setPhone(String phone)
    {
        this.phone = phone;
    }

    public void setEmail(String email)
    {
        this.email = email;
    }

    public String getId()
    {
        return id;
    }

    public String getName()
    {
        return name;
    }

    public String getAddress()
    {
        return address;
    }

    public String getPhone()
    {
        return phone;
    }

    public String getEmail()
    {
        return email;
    }

    public double getTotalAmount()
    {
        return totalAmount;
    }

    public void setTotalAmount(double totalAmount)
    {
        this.totalAmount += totalAmount;
    }

    public int compareTo(IFPerson person)
    {
        if(getTotalAmount() < person.getTotalAmount())
        {
            return 1;
        }
        else{
            if(getTotalAmount() == person.getTotalAmount())
            {
                return 0;
            }
            else{
                return -1;
            }
        }
    }
}